package com.fs.controller;

import com.fs.pojo.GoodsInfo;
import com.fs.vo.PageResult;
import com.fs.vo.SysResult;
import com.fs.service.GoodsInfoSerivce;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Api(tags = "商品详情-废弃")
@RestController
@RequestMapping("/goodsInfo")
public class GoodsInfoController {
    @Autowired
    private GoodsInfoSerivce goodsInfoSerivce;

    @PostMapping("/add")
    public SysResult add(@RequestBody GoodsInfo entity){
        return goodsInfoSerivce.add(entity);
    }

    @PutMapping("/edit")
    public SysResult edit(@RequestBody GoodsInfo entity){
        return goodsInfoSerivce.edit(entity);
    }

    @GetMapping("/list")
    public SysResult list(PageResult request){
        return goodsInfoSerivce.list(request);
    }

    @DeleteMapping("/{id}")
    public SysResult deleteById(@PathVariable("id") Integer id){
        return goodsInfoSerivce.delById(id);
    }
}
